package br.com.registrofinancas.componente;

import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.util.AttributeSet;
import android.widget.ImageView;
import br.com.registrofinancas.R;

public class CustomViewImage extends ImageView {

	public CustomViewImage(Context context) {
		super(context);
	}

	public CustomViewImage(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public CustomViewImage(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
	}

	@Override
	protected void drawableStateChanged() {
		super.drawableStateChanged();
		ColorStateList list = getResources().getColorStateList(R.color.tab_icon_selector);
		int color = list.getColorForState(getDrawableState(), Color.WHITE);
		setColorFilter(color);
		invalidate();
	}

}